package com.qiguliuxing.dts.common.type;

import lombok.Getter;

/**
 * 用户类型的枚举类
 * 
 * @author qiguliuxing
 * @QQ 623659388
 * @since 1.0.0
 */
@Getter
public enum UserTypeEnum {

	// 普通会员用户
	COMM_USER((byte) 0, "普通用户"),

	// VIP用户
	VIP_USER((byte) 1, "VIP"),

	// 代理推广分销员
	REGIONAL_AGENCY((byte) 2, "区域代理");

	private Byte level;
	private String desc;

	UserTypeEnum(Byte level, String desc) {
		this.level = level;
		this.desc = desc;
	}

	public static UserTypeEnum getInstance(Byte level2) {
		if (level2 != null) {
			for (UserTypeEnum tmp : UserTypeEnum.values()) {
				if (tmp.level.intValue() == level2.intValue()) {
					return tmp;
				}
			}
		}
		return null;
	}
}
